<?php require 'gauche.tpl.php';?>
	<div id="content">
	    <div>
	    <h2>Agenda</h2>
		<?php $actif = 1;?>	
			<table class="agenda">
			<caption>
			<?php foreach ($enteteCalendrier as $key => $mois) {
			    if ($key === 0) { ?>
			        <?php echo $mois['texte'] ?>
			    <?php } else { ?>
			    <span class='petit'><a href="<?php echo $baseUri; ?>Agenda/Afficher/<?php echo $mois['valeur'].'/'.$mois['annee']; ?>"><?php echo $mois['texte'] ?></a></span>
			    
			<?php }
			 } ?>
			</caption>
			<?php foreach ($calendrier as $cal => $li) { ?>
			    <tr>
			    <?php foreach ($li as $col) { ?>
			    <?php if($col['actif'] !== true) { 
			        $class = 'class="disabled '.$col['class'].'"';
		        }
		        else {
                    $class = '';
                    if ($col['class'] !== '') {
                        $class = 'class="'.$col['class'].'"';
                    }
                } ?>
			    <td <?php echo $class ?> >
			        <div class="jour"><?php echo $col['jour'] ?>
			        <?php if ($creationEvent === true) {?>
			            <a id="<?php echo $col['id']?>" href="javascript:ShowListe(<?php echo $col['id']?>)"><img alt="calendrier" src="<?php echo $baseUri;?>/images/Calendar-Date.png" /></a>
			            <?php }?>
		            </div>
			         <?php if (isset($listeEvent[$col['id']]) === true) {?>
			         <ul class="Event">
			         <?php foreach ($listeEvent[$col['id']] as $agenda) {?>
			         	<li>
                            <a href="javascript:showAction(<?php echo $agenda['agenda_id'],',',$agenda['clan_id'],',',$_SESSION['accountInfo']['clanId'];?>)" id="<?php echo $agenda['agenda_id'];?>" title="<?php echo 'inscrits : ',$agenda[1], '&#10;backup : ', $agenda[2], '&#10;absents : ', $agenda[3] ;?>"><img alt="<?php echo $agenda['nom'];?>" src="<?php echo $agenda['image'];?>" />
                               <?php echo $agenda['nom']?>
                            <span><?php echo '(<span class="inscrits">'.$agenda[1].'</span><span class="backup">'.$agenda[2].'</span><span class="absents">'.$agenda[3].'</span>)';?></span></a>
                            <?php if (isset($inscriptions[$agenda['agenda_id']]) === true) {?>
                            <img alt="status" src="<?php echo $baseUri;?>images/<?php echo $agendaActions[$inscriptions[$agenda['agenda_id']]]['image']; ?>"/>
                            <?php } ?>
                        </li>
			         <?php } ?>
			         </ul>
			        <?php }?>
			    </td>
			    <?php } ?>
			    </tr>
			<?php } ?>
		    
			</table>	
		</div>
	</div>
	<div id="typeEvent" class="menuDynamique">
	   <ul>
       <?php foreach ($typeEvents as $type) { ?>
           <li>
                <a href="javascript:enregistrerEvent(<?php echo $type['event_id'].','.$type['esl_id']?>)">
                    <img alt="<?php echo $type['nom']; ?>" src="<?php echo $type['image']; ?>" /> 
                <?php echo $type['nom']; ?></a>
            </li>
       <?php } ?>
	   </ul>
	</div>
	<div id="agendaAction" class="menuDynamique">
	   <ul>
       <?php foreach ($agendaActions as $action) { ?>
           <li>
                <a href="<?php echo $action['url'];?>">
                    <img alt="<?php echo $action['libelle']; ?>" src="<?php echo $baseUri;?>/images/<?php echo $action['image']; ?>" />  
                <?php echo $action['libelle']; ?></a>
            </li>
       <?php } ?>
	   </ul>
	</div>
	<form action="" method="post" name="postEvent">
	   <input id="tEvent" type="hidden" name="typeEvent" value=""/>
	   <input id="dateEvent" type="hidden" name="dateEvent" value=""/>
	</form>
